//
// CTextureFar.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

public class CTextureFar extends ITexture {
  private long swigCPtr;

  public CTextureFar(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CTextureFar_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CTextureFar obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CTextureFar(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public CTextureFar() {
    this(nel3dJNI.new_CTextureFar(), true);
  }

  public int tryAllocatePatch(CPatch pPatch, long farIndex) {
    return nel3dJNI.CTextureFar_tryAllocatePatch(swigCPtr, this, CPatch.getCPtr(pPatch), pPatch, farIndex);
  }

  public void allocatePatch(CPatch pPatch, long farIndex, SWIGTYPE_p_float farUScale, SWIGTYPE_p_float farVScale, SWIGTYPE_p_float farUBias, SWIGTYPE_p_float farVBias, SWIGTYPE_p_bool bRot) {
    nel3dJNI.CTextureFar_allocatePatch(swigCPtr, this, CPatch.getCPtr(pPatch), pPatch, farIndex, SWIGTYPE_p_float.getCPtr(farUScale), SWIGTYPE_p_float.getCPtr(farVScale), SWIGTYPE_p_float.getCPtr(farUBias), SWIGTYPE_p_float.getCPtr(farVBias), SWIGTYPE_p_bool.getCPtr(bRot));
  }

  public void removePatch(CPatch pPatch, long farIndex) {
    nel3dJNI.CTextureFar_removePatch(swigCPtr, this, CPatch.getCPtr(pPatch), pPatch, farIndex);
  }

  public void doGenerate(boolean async) {
    nel3dJNI.CTextureFar_doGenerate__SWIG_0(swigCPtr, this, async);
  }

  public void doGenerate() {
    nel3dJNI.CTextureFar_doGenerate__SWIG_1(swigCPtr, this);
  }

  public long touchPatchULAndNext() {
    return nel3dJNI.CTextureFar_touchPatchULAndNext(swigCPtr, this);
  }

  public void startPatchULTouch() {
    nel3dJNI.CTextureFar_startPatchULTouch(swigCPtr, this);
  }

  public boolean endPatchULTouch() {
    return nel3dJNI.CTextureFar_endPatchULTouch(swigCPtr, this);
  }

  public void linkBeforeUL(CTextureFar textNext) {
    nel3dJNI.CTextureFar_linkBeforeUL(swigCPtr, this, CTextureFar.getCPtr(textNext), textNext);
  }

  public void unlinkUL() {
    nel3dJNI.CTextureFar_unlinkUL(swigCPtr, this);
  }

  public CTextureFar getNextUL() {
    long cPtr = nel3dJNI.CTextureFar_getNextUL(swigCPtr, this);
    return (cPtr == 0) ? null : new CTextureFar(cPtr, false);
  }

  public void set_Bank(CTileFarBank value) {
    nel3dJNI.CTextureFar__Bank_set(swigCPtr, this, CTileFarBank.getCPtr(value), value);
  }

  public CTileFarBank get_Bank() {
    long cPtr = nel3dJNI.CTextureFar__Bank_get(swigCPtr, this);
    return (cPtr == 0) ? null : new CTileFarBank(cPtr, false);
  }

}
